package com.bestdreamer.design.principle.openclose;

public class JavaDiscountCourse extends JavaCourse{

    public JavaDiscountCourse(Integer id, String name, Double price) {
        super(id, name, price);
    }

    /**
     * 获取原始价格
     * @return
     */
    public Double getOriginPrice(){
        return super.getPrice();
    }

    /**
     * 重写方法
     * 打八折
     */
    @Override
    public Double getPrice() {
        return super.getPrice() * 0.8;
    }
}
